def add(a,b):
    result = a+b
    return result


result=add(1,2)
# print(result)

#编写一个计算器
def jisuan(a,opt,b):
    if opt == "+":
        print(a+b)
    elif opt == "-":
        print(a-b)
    elif opt == "*":
        print(a*b)
    elif opt == "/":
        print(a/b)
    else:
        print("error")


# jisuan(17,"*",3)

def lunch(chi,zhu,xing):
    print(chi,zhu,xing)

#
# lunch("rice","house","car")
# lunch(chi="juice",zhu="newHouse",xing="brick")
# lunch("juice666",zhu="newHouse",xing="brick")


def Dfunc(*food):           #*表示位置参数的动态传参，*接收到的值会被统一放在一个元祖里面    ()
    print(food)

Dfunc("rice","house","car")


def func2(**food):          #** 表示接收关键字的动态传参，接收到的所有参数都会被处理成字典   {}
    print(food)


func2(name="rice",name2="meet",name3="vegetable")


def func3(*args,**args2):
    print(args,args2)


func3(1,2,3,4,5,{"key":"value"},name="rice")#(1, 2, 3, 4, 5, {'key': 'value'}) {'name': 'rice'}